<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib prefix="sf" uri="http://www.springframework.org/tags/form" %>
<!DOCTYPE html>
<html>
<head>
    <title>${formField.titleTag}</title>
    <meta name="description" content="${formField.descripTag}">
    <meta name="keywords" content="${formField.keywordTag}">
    <meta name="viewport" content="width=device-width"/>
    <meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
    <link rel="shortcut icon" href="static/templates/templ${formField.idTemplate}/images/favicon.ico"/>
    <link rel="stylesheet" href="static/templates/templ${formField.idTemplate}/style.css" type="text/css" media="all"/>
    <script src="static/js/jquery-1.7.2.min.js" type="text/javascript"></script>
    <script src="static/js/html5.js" type="text/javascript"></script>
    <script src="static/js/functions.js" type="text/javascript"></script>
    <script src="static/js/jquery.validate.js" type="text/javascript"></script>
    <script src="static/js/validform.js" type="text/javascript"></script>
    <script>
        $(document).ready(function () {
            $('a.back').click(function () {
                parent.history.back();
                return false;
            });

            //скрипт для захвата мыла подписчиков
            var email = '';
            var pattern = /^[a-z0-9_-]+@[a-z0-9-]+\.([a-z]{1,6}\.)?[a-z]{2,6}$/i; //
            //скрытый тег с айдишником странички, откуда возьму его значение, либо просто сразу в get подставлять
            var idPage = $('#siteID').val();
            $(':submit').click(function (e) {
                //выбираю атрибуты name, в значениях которых есть слово email, т.к. бывают случаи с field_email
                email = $("input[name~='email']").val();
                if (email.search(pattern) == 0) {
                    $.get("addsubscriber.html?email=" + email + "&site_id=" + idPage);
                }
            });

        });
    </script>
    <style>
        #specpanel {
            position: absolute;
            z-index: 2;
            bottom: 10px;
            right: 65px;
            width: 350px;
            text-align: center;
        }

        .insidepanel {
            width: 70px;
            margin-right: 7px;
            background-color: #ffffff;
            -moz-border-radius: 6px;
            -webkit-border-radius: 6px;
            border-radius: 6px;
            border: 1px solid #000000;
            behavior: url(../../static/css/ie/PIE.htc);
        }

        .tdpanel :hover {
            background-color: #c0c0c0;
        }
    </style>
</head>
<body>
<section id="wrapper">
    <section id="bg">
        <img src="static/templates/templ${formField.idTemplate}/images/bg.jpg"
             style="top: -54.375px; left: -45.5px; opacity: 1;" alt=""/>
    </section>
    <!-- /#bg -->

    <section class="content-box" style="left:${formField.blackBox}%;">
        <!--<h1 id="logo"><a href="#" class="notext"></a></h1>-->
        <section class="blackbox">
            <h1>${formField.mainHeader}</h1>
            <h2>${formField.briefDef}</h2>
            <p>${formField.dopText}</p>
            <sf:form method="POST" action="addorder.html" commandName="order" >
                <table>
                    <tr>
                        <td>Имя</td>
                        <td><sf:input id="name" path="name" value="" class="field"/></td>
                    </tr>
                    <tr>
                        <td>Email</td>
                        <td><sf:input id="email" path="email" value="" class="field"/></td>
                    </tr>
                    <tr>
                        <td>Телефон</td>
                        <td> <sf:input id="phone" path="phone" value="" class="field"/></td>
                    </tr>
                    <tr>
                        <td>Город</td>
                        <td><sf:input id="city" path="city" value="" class="field"/></td>
                    </tr>
                    <tr>
                        <td>Комментарий</td>
                        <td><sf:textarea id="comment" path="comment" value="" class="field"></sf:textarea></td>
                    </tr>
                </table>
                <%--<input type="hidden" id="idTemplate"  path="idTemplate" value="${formField.idTemplate}"/>--%>
                <sf:hidden id="siteId"  path="siteId"/>

                <input type="submit" value="${formField.btnTxt}" class="submit"/>
            </sf:form>
            <p></p>
            <!--<p>Конфиденциальность данных гарантируется</p>-->
            <a href="http://${formField.mySite}" target="_blank">${formField.companyName}</a>
            <p></p>
        </section>
        <!-- /.blackbox -->
        <footer class="footer">
            <p>Работает на <a href="http://alobov.ru/lg" target="_blank">StarKuz LeadGen</a></p>
        </footer>
    </section>
    <!-- /.content-box -->
</section>
<!-- код статистики -->
${formField.statCode}
<!-- код статистики -->
<c:if test="${empty notshow}">
    <div id="specpanel">
        <table style="width:340px; border:0px; text-align:center;">
            <tr>
                <td class="tdpanel">
                    <p>

                    <div class="insidepanel"><a href="userhome_orders.html"><img src="static/img/menu_up_right/user.png"
                                                                                 title="кабинет" width="64" alt=""></a>
                    </div>
                    </p>
                </td>
                <td class="tdpanel">
                    <p>

                    <div class="insidepanel"><a href="templates.html"><img src="static/img/specpanel/templates.png"
                                                                           title="список шаблонов" width="64"
                                                                           alt=""></a></div>
                    </p>
                </td>
                <td class="tdpanel">
                    <c:choose>
                        <c:when test="${not empty formField.idSite}">
                            <p>

                            <div class="insidepanel"><a class="back" href="#"><img src="static/img/specpanel/edit.png"
                                                                                   title="редактировать" width="64"
                                                                                   alt=""></a></div>
                            </p>
                        </c:when>
                        <c:otherwise>
                            <p>

                            <div class="insidepanel"><a class="back" href="edit_order_site.html?id=${formField.idSite}"><img
                                    src="static/img/specpanel/edit.png" title="редактировать" width="64" alt=""></a>
                            </div>
                            </p>
                        </c:otherwise>
                    </c:choose>
                </td>
                <c:if test="${empty formField.idSite}">
                    <td class="tdpanel">
                        <p>

                        <div class="insidepanel"><a href="save_order_site.html"><img src="static/img/specpanel/save.png"
                                                                                     title="сохранить" width="64"
                                                                                     alt=""></a></div>
                        </p>
                    </td>
                </c:if>
                <!--<td class="tdpanel">
                    <p><div class="insidepanel"><a href="download?templId=1"><img src="static/img/specpanel/download.png" title="скачать" width="64" alt=""></a></div></p>
                </td>-->
            </tr>
        </table>
    </div>
</c:if>
</body>
</html>
